package com.micro.boot.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

import com.zaxxer.hikari.HikariDataSource;

/**
 * @Title:
 *         <P>
 * 		HikariConfig.java
 *         </P>
 * @Package
 *          <P>
 * 			com.micro.boot.config
 *          </P>
 * @Description:
 *               <P>
 * 				Hikari 数据源配置
 *               </P>
 * @author renweiping
 * @date 2018年9月21日 下午5:22:59
 * @version 1.0
 */
//@Configuration
//@PropertySource("classpath:hikariDb.properties")
public class HikariDbConfig {

	@Bean
	@ConfigurationProperties(prefix = "hikari.datasource")
	public HikariDataSource dataSource() {

		return DataSourceBuilder.create().type(HikariDataSource.class).build();
	}
	
	
	
	@Bean
	@ConfigurationProperties(prefix = "hikari.datasource2")
	public HikariDataSource dataSource2() {

		return DataSourceBuilder.create().type(HikariDataSource.class).build();
	}

}
